package com.luych.toolbox.common.service.configuration;

import com.luych.toolbox.common.event.base.service.publisher.*;
import org.springframework.cloud.bus.BusProperties;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WebSockerConfiguration {

    @Bean
    public WebSocketChatPublisher webSocketChat(BusProperties busProperties,
                                                ApplicationEventPublisher applicationEventPublisher) {
        return new WebSocketChatPublisher(busProperties, applicationEventPublisher);
    }

    @Bean
    public WebSocketNoticePublisher webSocketNotice(BusProperties busProperties,
                                                    ApplicationEventPublisher applicationEventPublisher) {
        return new WebSocketNoticePublisher(busProperties, applicationEventPublisher);
    }

    @Bean
    public WebSocketLetterPublisher webSocketLetter(BusProperties busProperties,
                                                    ApplicationEventPublisher applicationEventPublisher) {
        return new WebSocketLetterPublisher(busProperties, applicationEventPublisher);
    }

    @Bean
    public WebSocketEventPublisher webSocketEvent(BusProperties busProperties,
                                                  ApplicationEventPublisher applicationEventPublisher) {
        return new WebSocketEventPublisher(busProperties, applicationEventPublisher);
    }

    @Bean
    public WebSocketTaskPublisher webSocketTask(BusProperties busProperties,
                                                ApplicationEventPublisher applicationEventPublisher) {
        return new WebSocketTaskPublisher(busProperties, applicationEventPublisher);
    }
}
